Embodiments of the present disclosure are directed to an image processing device, an image processing method, and an image processing program.
Imaging devices, such as digital still cameras, are widely used. A dynamic range compression technology such as high dynamic range (HDR) or backlight compensation is used in some imaging devices. Such imaging devices compress a range of one or both of a highlight area and a shadow area of an image of a subject for which a brightness range is wider than a dynamic range of an imaging element, to acquire an image.
Furthermore, a technology for improving visibility of an image having a compressed brightness range uses image processing based on retinex theory on the image to perform local dynamic range compensation. Based on retinex theory, brightness components of an input image are divided into illumination light components and reflectivity components, and the illumination light components are modulated and then combined with the reflectivity components, to obtain an output image having a locally compensated dynamic range.
Based on retinex theory, a smoothing filter can be applied to the input image to extract the illumination light components. Due to the application of the smoothing filter to the input image, an unnatural image pattern not originally present in the image, i.e., a halo phenomenon, may form in a boundary region between a subject and a background.
An ε filter can be applied as a smoothing filter and a value of ε is controlled, so that smoothing is performed while an edge is maintained. Based on an application of this smoothing filter, a boundary between a background and a subject, referred to as a “stairs tone edge”, is not differentiated from a boundary in which contrast (gradation) is changed by a subject's shape, referred to as a “pattern tone edge”. Therefore, for example, even if a subject is uniformly with an illumination that does not depend on the subject's shape, an edge may be maintained at a high contrast portion and the shape itself may be treated as an illumination light component. Therefore, an image free from a halo phenomenon may be obtained, but contrast may be deteriorated with respect to the subject's shape.